﻿using System;
using System.Collections.Generic;
using System.Linq;

namespace KL.Store.Core.Localization
{
    public static class Current
    {
        public static string DefaultCulture = "";
        public static IList<KL.Store.Core.Domain.Localization> LM;

        public static string Get(string culture, string defaultText)
        {
            if (DefaultCulture == culture)
            {
                return defaultText;
            }
            else
            {
                return LM.Where(lm => lm.CultureId == culture && lm.DefaultText == defaultText).Select(lm => lm.TranslatedText).FirstOrDefault();
            }
        }
    }
}
